<?php
namespace module\tv\controller;

use think\Request;
use core\tv\model\PlayLogModel;
use core\tv\validate\PlayLogValidate;

class PlayLog extends Base
{

    /**
     * 播放记录列表
     * 
     * @param Request $request
     * @return mixed
     */
    public function index(Request $request)
    {
        $this->siteTitle = '播放记录';

        //列表
        $model = PlayLogModel::getInstance()->aliasQuery('pl')->order('pl.id DESC');
        $this->_page($model);

        //类型
        $types = [
            '0' => '结束',
            '1' => '播放',
            '2' => '暂停'
        ];
        $this->assign('types',$types);

        return $this->fetch();
    }

    /**
     * 删除播放记录
     * 
     * @param Request $request
     * @return void
     */
    public function delete(Request $request)
    {
        $this->_delete(PlayLogModel::class, false);
    }
}